#!/bin/bash
cp=0
cf=0
echo Par ameters: 500, 500
echo Expected Output: Invalid Input
java -jar Grades_v2.jar 500 500
EO="Invalid Input"
AO=$(java -jar Grades_v2.jar 500 500)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi

EO="Component Fail"
AO=$(java -jar Grades_v2.jar 40 40)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi

echo Parameters: 39, 39
echo Expected Output: Component Fail
java -jar Grades_v2.jar 39 39

EO="Component Fail"
AO=$(java -jar Grades_v2.jar 39 39)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi

echo Parameters: 65 65
echo Expected Output: Pass
java -jar Grades_v2.jar 65 65

EO="Pass"
AO=$(java -jar Grades_v2.jar 65 65)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi

echo Parameters: 99, 99
echo Expected Output: Pass with distinction
java -jar Grades_v2.jar 99 99

EO="Pass with distinction"
AO=$(java -jar Grades_v2.jar 99 99)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi

echo Parameters: 100, 100
echo Expected Output: Pass with distinction
java -jar Grades_v2.jar 100 100

EO="Pass with distinction"
AO=$(java -jar Grades_v2.jar 100 100)
if [ "$EO" != "$AO" ]
then let "cf += 1"
else let "cp += 1"
fi


echo $cp tests were succesful and $cf tests were not

